package com.undsf.comikamij;

import com.undsf.comikamij.core.BaseCrawler;
import com.undsf.comikamij.core.entities.Chapter;
import com.undsf.comikamij.core.entities.Page;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import com.undsf.comikamij.kukudm.KukuCrawler;

import java.util.List;

/**
 * Created by Arathi on 2017/4/7.
 */
public class Launcher {
    private static Logger logger = LogManager.getLogger(Launcher.class);
    public static void main(String[] args) {
        BaseCrawler crawler = new KukuCrawler();

        // List<Comic> comics = crawler.crawlIndex();
        // for (Comic comic : comics) {
        //     logger.info(comic);
        // }

        List<Chapter> chapters = crawler.crawlTOC("364");

        for (Chapter chapter : chapters) {
            logger.info(chapter);
        }

        List<Page> pages = crawler.crawlPagesOfChapter("364", "52558");

        for (Page page : pages) {
            logger.info(page);
        }
    }
}
